package io.eyer;

import io.eyer.nio.core.event.Acceptor;
import io.eyer.nio.core.event.ReactorPool;
import io.eyer.nio.core.support.NioConfig;
import io.eyer.rpc.Server;
import io.eyer.rpc.codec.JdkCodec;
import io.eyer.rpc.handler.ServerHandler;

import java.io.IOException;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) throws IOException {
        NioConfig.registered(new JdkCodec());
        NioConfig.registered(new ServerHandler());

        ReactorPool reactorPoolPool = new ReactorPool(1);
        Acceptor accpectEventLoop = new Acceptor(reactorPoolPool);
        Server server = new Server("localhost", 6161, accpectEventLoop);
        server.start();
    }
}
